{% load static %}
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="author" content="常伟">
  <title>知识问答</title>
  <link rel="stylesheet" href="{% static "libs/bootstrap/css/bootstrap.css" %}">
{#  <link rel="stylesheet" href="static/libs/bootstrap/css/bootstrap.css">#}
  <link rel="stylesheet" href="{% static "libs/font-awesome/css/font-awesome.css" %}">
{#  <link rel="stylesheet" href="static/libs/font-awesome/css/font-awesome.css">#}
  <link rel="stylesheet" href="{% static "libs/simditor/styles/simditor.css" %}">
{#  <link rel="stylesheet" href="static/libs/simditor/styles/simditor.css">#}
  <link rel="stylesheet" href="{% static "css/main.css" %}">
</head>

<body>
  <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">智游问答</a>
      </div>
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
          <li class="active"><a href="{% url 'questions:index' %}">最新问题 <span class="sr-only">(current)</span></a></li>
          <li><a href="{% url 'questions:index' %}">最难问题
          </a></li>
          <li><a href="{% url 'questions:question' %}">我的提问</a></li>
          <li><a href="#">我的回答</a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li class="dropdown">
            <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ cook }} <span class="caret"></span></a>
            <ul class="dropdown-menu">
              <li><a href="#">个人信息</a></li>
              <li><a href="#">退出登录</a></li>
            </ul>
          </li>
        </ul>
      </div>
    </div>
  </nav>
  <div class="container">
    <div class="row">
      <div class="col-md-3 col-md-push-9">
        <form class="form-right">
          <div class="form-group">
            <div class="input-group">
              <input type="text" class="form-control" placeholder="搜索问题">
              <span class="input-group-btn"><a href="search.html" class="btn btn-default glyphicon glyphicon-search" type="button"></a></span>
            </div>
          </div>
        </form>
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">分类</h3>
          </div>
          <div class="panel-body keywords">
            <span class="label label-default">大数据</span>
            <span class="label label-default">Java</span>
            <span class="label label-default">PHP</span>
            <span class="label label-default">Python</span>
            <span class="label label-default">NodeJs</span>
            <span class="label label-success">Web前端</span>
            <span class="label label-default">VR</span>
            <span class="label label-default">UI</span>
            <span class="label label-default">网络安全</span>
          </div>
        </div>
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">标签</h3>
          </div>
          <div class="panel-body keywords">
            <span class="label label-default">jQuery</span>
            <span class="label label-default">Require.js</span>
            <span class="label label-default">artTemplate</span>
            <span class="label label-default">MongoDB</span>
            <span class="label label-default">mongoose</span>
            <span class="label label-default">angular</span>
            <span class="label label-default">ionic</span>
            <span class="label label-default">Cordova</span>
            <span class="label label-default">PhoneGap</span>
            <span class="label label-success">Bootstrap</span>
            <span class="label label-default">jQuery</span>
            <span class="label label-default">Require.js</span>
            <span class="label label-default">artTemplate</span>
            <span class="label label-default">MongoDB</span>
            <span class="label label-default">mongoose</span>
            <span class="label label-default">angular</span>
            <span class="label label-default">ionic</span>
            <span class="label label-default">Cordova</span>
            <span class="label label-default">PhoneGap</span>
            <span class="label label-default">Bootstrap</span>
          </div>
        </div>
      </div>
      <div class="col-md-9 col-md-pull-3">
        <div class="panel panel-default">
          <div class="panel-body question">
            <div class="row">
              <div class="col-xs-7">
                <h2>最新问题</h2>
              </div>
              <div class="col-xs-5 text-right">
                <a href="{% url 'questions:question' %}" class="btn btn-success add-question">&nbsp;<span class="glyphicon glyphicon-plus-sign"></span> 提问&nbsp;</a>
              </div>
            </div>
             {% for post in posts %}
             {% autoescape off %}


            <div class="media">
              <a class="media-left" href="#">
                <img class="media-object" src="{{ post.u_id.img.url }}" style="height: 64px;width: 64px;">
              </a>
              <div class="media-body">
                <h4 class="media-heading"><a href="{% url 'questions:reply' post.id %}">{{ post.title }}</a></h4>{{ post.content }}
                <div class="row keys">
                  <div class="col-md-8"><span class="label label-success">Bootstrap</span>
                    <span class="label label-default">MongoDB</span></div>
                  <div class="col-md-4 text-right"><span class="label label-success">难 {{ post.degree }}</span></div>
                </div>
                <div class="time">
                  {{ post.datetime }}
                </div>
              </div>
            </div>
              {% endautoescape %}
              {% endfor %}

            <div class="text-center">
              <ul class="pagination">
              {% if posts.object_list and posts.paginator.num_pages > 1 %}
                <li><a href="/question/index/?page=1">首页</a></li>
                {% if posts.has_previous %}
                <li><a href="/question/index/?page={{ posts.previous_page_number }}">上一页</a></li>
                {% endif %}

                {% if posts.has_next %}
                <li><a href="/question/index/?page={{ posts.next_page_number }}">下一页</a></li>
                {% endif %}
                <li><a href="/question/index/?page={{ posts.paginator.num_pages }}">尾页</a></li>
              {% endif %}
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="text-center page-footer">
    <p class="visible-xs-block visible-sm-block visible-md-inline visible-lg-inline">智游教育问答 &nbsp;&nbsp; &copy;zhiyou100.com</p>
    <p class="visible-md-inline visible-lg-inline">&nbsp;&nbsp;</p>
    <p class="visible-md-inline visible-lg-inline">河南智游臻龙教育科技有限公司</p>
  </div>
{#  <script src="static/libs/jquery/jquery.js"></script>#}
  <script src="{% static "libs/jquery/jquery.js" %}"></script>
{#  <script src="static/libs/bootstrap/js/bootstrap.js"></script>#}
  <script src="{% static "libs/bootstrap/js/bootstrap.js" %}"></script>
</body>

</html>
